package com.weiwei.diancan.adapter;

import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.weiwei.diancan.R;
import com.weiwei.diancan.bean.LoginBean;

import java.util.List;

import weiwei.com.weiweilibrary.adapter.BaseQuickAdapter;
import weiwei.com.weiweilibrary.holder.BaseViewHolder;

/**
 * Created by BMW on 2016/11/25.
 */
public class OrderDetailAndAdapter extends BaseQuickAdapter<LoginBean.OrderListBean.LogListBean> {

    public OrderDetailAndAdapter(List<LoginBean.OrderListBean.LogListBean> data) {
        super(R.layout.item_order_swip, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, LoginBean.OrderListBean.LogListBean item, int position) {
        RelativeLayout ll_all =  helper.getView(R.id.ll_all);
        TextView tv_name = helper.getView(R.id.tv_name);
        TextView tv_num = helper.getView(R.id.tv_num);
        TextView tv_shu = helper.getView(R.id.tv_shu);
        ImageView iv_tao = helper.getView(R.id.iv_tao);
        ll_all.setBackgroundColor(Color.WHITE);

        tv_name.setText(item.getLog_name());
        tv_num.setText("¥"+item.getLog_price());
        tv_shu.setText(item.getLog_count());

        String log_type = item.getLog_type();
        if(log_type.equals("1")){
            iv_tao.setVisibility(View.VISIBLE);
        }else{
            iv_tao.setVisibility(View.GONE);
        }
    }
}
